<?php
  require_once('system/dbConn.php');
  require_once('system/myFunc.php');
  //连接数据库		
  connect();

  if(!empty($_FILES["xjn_jiajulink"]["name"])){
  	$xjn_jiajulink = uploadfile('xjn_jiajulink','uploads/',array('jpg','gif','png'));
  }
  else{
  	$xjn_jiajulink='';
  }

  $data = array(
		'xjn_name' => trim($_POST['xjn_name']),  
		'xjn_cid' => $_POST['xjn_cid'],
		'xjn_brand' => $_POST['xjn_brand'],
		'xjn_intro' => $_POST['xjn_intro'],
		'xjn_jiajulink'=>$xjn_jiajulink
  	);

  //执行SQL语句
	$result = add('jiaju',$data);

  if(!$result){
  	echo "添加失败！<br/>";
  	echo "<a href='addjiaju.php'>返回</a>";	  
  }else{	  
 	echo "添加成功！";
	echo "或返回<a href='list.php'>家具列表</a>页面！";	  
  }    
  
?>